package com.cz.video.website.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.cz.video.common.annotation.LegalContent;
import com.cz.video.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 评论表
 * </p>
 *
 * @author LLF
 * @since 2023-10-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("website_comment")
@Schema(description="评论表")
public class WebsiteComment extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    @TableId(value = "comment_id")
    private Long commentId;

    @Schema(title = "被评论的电影的ID")
    private Long targetId;

    @Schema(title = "评论人的ID")
    private Long userId;

    @Schema(title = "父级评论的id")
    private Long parentId;

    @Schema(title = "评论的状态")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private String status;

    @LegalContent
    @Schema(title = "评论的内容")
    private String content;

    @Version
    @JsonIgnore
    @Schema(title = "版本号")
    private Integer version;

    @Schema(title = "支持（赞）")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer support;

    @Schema(title = "反对（踩）")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer oppose;

    @TableLogic
    @JsonIgnore
    @Schema(title = "删除标志（0代表存在 1代表删除）")
    private String delFlag;

}
